from a2a.server.apps import A2AStarletteApplication
from a2a.types import AgentCard, AgentSkill, AgentCapabilities


skill = AgentSkill(
    id="h2",
    name="hw",
    description="hw",
    tags=["hw"],
    examples=["hi"]
)

agent_card = AgentCard(
    name='hw',
    description='hw',
    version='1.0',
    defaultInputModes=['text'],
    defaultOutputModes=['text'],
    capabilities=AgentCapabilities(stream=True,tools=True),
    skills=[skill],
    url="http:/0.0.0.0:9000",
)



#构建
server = A2AStarletteApplication(
    agent_card= agent_card,http_handler=None
)

import uvicorn
uvicorn.run(server.build(),host="0.0.0.0",port=9000)